package com.clkj.sunhelp.adapter.list;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.clkj.sunhelp.R;
import com.clkj.sunhelp.bean.PublicityOfProcessStepResultItem;

import java.util.List;

/**审批节点公示list adapter
 * Created by Administrator on 2017/3/31.
 */

public class ListAdapterForShenPiStepPublicity extends BaseAdapter {


    List<PublicityOfProcessStepResultItem> mPublicityList;
    Context mContext;
    LayoutInflater mLayoutInflater;

    public ListAdapterForShenPiStepPublicity(Context context, List<PublicityOfProcessStepResultItem> mPublicityList) {
        mContext = context;
        this.mPublicityList = mPublicityList;
        mLayoutInflater = LayoutInflater.from(context);
    }

    @Override
    public int getCount() {
        return mPublicityList.size();
    }

    @Override
    public Object getItem(int i) {
        return mPublicityList.get(i);
    }

    @Override
    public long getItemId(int i) {
        return i;
    }

    @Override
    public View getView(int i, View view, ViewGroup viewGroup) {

        ViewHolder viewHolder = null;
        if (view == null)
        {
            view = mLayoutInflater.inflate(R.layout.list_item_shenpi_step_publicity,null);
            viewHolder = new ViewHolder();
            viewHolder.tvHuzhuName = (TextView) view.findViewById(R.id.tv_huzhu_name);
            viewHolder.tvIdcardNo = (TextView) view.findViewById(R.id.tv_idcard_no);
            viewHolder.tvApplyTime = (TextView) view.findViewById(R.id.tv_apply_time);
            viewHolder.tvApplyHelpReason = (TextView) view.findViewById(R.id.tv_apply_help_reason);
            viewHolder.tvCurExamProcess = (TextView) view.findViewById(R.id.tv_cur_exam_process);



            view.setTag(viewHolder);

        }else {
            viewHolder = (ViewHolder) view.getTag();
        }

        PublicityOfProcessStepResultItem publicity = mPublicityList.get(i);

        viewHolder.tvHuzhuName.setText(publicity.getHZNAME());
        viewHolder.tvIdcardNo.setText(publicity.getSFZH());
        viewHolder.tvApplyTime.setText(publicity.getSQSJ());
        viewHolder.tvApplyHelpReason .setText(publicity.getSQJZYY());
        viewHolder.tvCurExamProcess .setText(publicity.getDQJD());

        return view;
    }


    static class ViewHolder{




        private TextView tvTipHuzhuName;
        private TextView tvHuzhuName;
        private TextView tvTipIdcardNo;
        private TextView tvIdcardNo;
        private TextView tvTipApplyTime;
        private TextView tvApplyTime;
        private TextView tvTipApplyHelpReason;
        private TextView tvApplyHelpReason;
        private TextView tvTipCurExamProcess;
        private TextView tvCurExamProcess;











    }


}
